import http from '@/utils/request.js'

/**
 * 用户名密码登录
 * @param {{username: string, password: string}} payload 
 * @returns Promise<any>
 */
export function namePassLogin(payload) {
	// 后端可能要求字段名为 username/password 或 account/password，请按需调整
	return http.post('/douyang/auth/login/namePassLogin', {
		username: payload.username,
		password: payload.password
	})
}


export function usernamePassword(payload) {
	// 后端可能要求字段名为 username/password 或 account/password，请按需调整
	return http.post('/douyang/auth/register/usernamePassword', {
		username: payload.username,
		password: payload.password
	})
}



export default {
	namePassLogin,
	usernamePassword
}


